const urlenCode = (url) => {
    // 获取?右边的参数 name=tom&age=18
    let strUrl = url.split("?")[1];
    // 将剩下的字符串按照 & 进行切割，返回[]
    let params = strUrl.split("&")
    console.log(params);
    let obj = {}
    for (let i = 0; i < params.length; i++) {
        let key = params[i].split("=")[0]
        let value = params[i].split("=")[1]
        obj[key] = value
    }
    return obj
}

console.log(urlenCode("?name=jhq&age=18&sex=男"))
// qaq